package synchronize;

public class WaitDemo {

    public void testWait() {
        System.out.println("Start-----");
        try {
            wait(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("End-------");
    }

    public static void main(String[] args) {
        final WaitDemo waitDemo = new WaitDemo();
        new Thread(new Runnable() {
            @Override
            public void run() {
                waitDemo.testWait();
            }
        }).start();
    }

}
